Cached data detection

ABSTRACT

A service assigns session identifiers to usage sessions of a program on a computing device, and maintains records in a log of received page requests and associated session identifiers, as well as received cached data detection requests and associated session identifiers. This log can be used to determine how many usage sessions existed over a particular amount of time, and how many of the usage sessions used data from a local cache rather than from the service. The service also returns, in response to a received cached data detection request, a response including an indication that the response is from the service. The program can determine that the response was received from the service if the indication is included in the response, and that the response was received from a local cache of the computing device if the indication is not included in the response.

BACKGROUND

Computers oftentimes access services over a network such as theInternet. Information used by computers in displaying data whenaccessing such services can be obtained from the service over thenetwork, or alternatively can be retrieved from a local cache of thecomputer (e.g., where the information was saved from a previous timewhen the service was accessed). Although it may be desirable to knowwhether the information is typically obtained by computers from theservice or from the local caches, it can be difficult for computers andservices to know how frequently the information is obtained from thelocal caches of the computers and how frequently the information isobtained from the service.

SUMMARY

This Summary is provided to introduce a selection of concepts in asimplified form that are further described below in the DetailedDescription. This Summary is not intended to identify key features oressential features of the claimed subject matter, nor is it intended tobe used to limit the scope of the claimed subject matter.

In accordance with one or more aspects, in a service requests for one ormore pages from the service are received from programs running oncomputing devices. For each request, information regarding the requestand a session identifier associated with a usage session of the programfrom which the request is received are stored. Additionally, the servicereceives from one or more of the programs both a cached data detectionrequest and the session identifier associated with the usage session ofthe program from which the cached data detection request is received.For each cached data detection request, information regarding the cacheddata detection request and the session identifier are stored.

In accordance with one or more aspects, a program on a computing devicesreceives, from a remote service in response to a page request, a pageand a session identifier associated with a usage session of the program.A cached data detection request targeting the remote service is alsosent, and a response to the cached data detection request is received.Based on an indication received with the response, a determination ismade as to whether the cached data detection response is provided by theremote service or by a local cache of the computing device.Additionally, a determination is made that data for the remote serviceis in the local cache if the cached data detection response is providedby the local cache, and that data for the remote service is not in thelocal cache if the cached data detection response is provided by theremote service.

BRIEF DESCRIPTION OF THE DRAWINGS

The same numbers are used throughout the drawings to reference likefeatures.

FIG. 1 illustrates an example system implementing the cached datadetection in accordance with one or more embodiments.

FIG. 2 illustrates example records in a log in accordance with one ormore embodiments.

FIG. 3 is a flowchart illustrating an example process for a computingdevice implementing cached data detection in accordance with one or moreembodiments.

FIG. 4 is a flowchart illustrating an example process for a serviceimplementing cached data detection in accordance with one or moreembodiments.

FIG. 5 illustrates an example computing device that can be configured toimplement the cached data detection in accordance with one or moreembodiments.

DETAILED DESCRIPTION

Cached data detection is discussed herein. When a program such as a Webbrowser on a device accesses a remote service, the program sends a pagerequest to the remote service. The remote service assigns a sessionidentifier to the current usage session of the program, and returns boththe requested page and the session identifier to the program. Theprogram then sends a cached data detection request to the servicerequesting particular data, and includes the session identifier with thecached data detection request. The service can readily track whetherdevices already have the particular data cached (and thus whether otherdata from the remote service is likely cached at the devices) based onthe number of session identifiers that are assigned and the number ofcached data detection requests that are received. By comparing the ratiobetween these two requests on the service side, an estimate can bedetermined of the percent of user sessions that have their content inthe cache of the program (if programs always had the particular datacached then no cached data detection requests would be received by theremote service). Additionally, the program can readily track whether thedevice already had the particular data cached (and thus whether otherdata from the remote service is likely cached at the device).

FIG. 1 illustrates an example system 100 implementing the cached datadetection in accordance with one or more embodiments. System 100includes a computing device 102 that can communicate, via a network 106,with a service 104 and content distribution network 108. Network 106 canbe a variety of different types of networks, including the Internet, alocal area network (LAN), a cellular or other phone network, anintranet, other public and/or proprietary networks, combinationsthereof, and so forth.

Computing device 102 can be a variety of different types of devices,such as a physical device or a virtual device. For example, computingdevice 102 can be a desktop computer, a server computer, a laptop ornetbook computer, a tablet or notepad computer, a mobile station, anentertainment appliance, a set-top box communicatively coupled to adisplay device, a television or other display device, a cellular orother wireless phone, a game console, an automotive computer, and soforth. Computing device 102 can also be a virtual device, such as avirtual machine running on a physical device. A virtual machine can berun on any of a variety of different types of physical devices (e.g.,any of the various types listed above).

Service 104 can be implemented by one or more of a variety of differenttypes of devices, analogous to computing device 102. Service 104 canprovide a variety of different types of services to computing device102, such as entertainment services (e.g., games, audio and/or videocontent, etc.), productivity services (e.g., word processingfunctionality, spreadsheet functionality, etc.), utility services (e.g.,data storage functionality, email functionality), social networkingservices, combinations thereof, and so forth. Service 104 is alsoreferred to as a remote service due to service 104 begin accessed bycomputing device 102 via network 106, and typically not being located inclose physical proximity to computing device 102 (e.g., accessed bycomputing device 102 via the Internet). Similarly, device 102 isreferred to as a remote device relative to service 104. Although asingle computing device 102 and service 104 are illustrated in system100, it should be noted that system 100 can include any number ofcomputing devices 102 communicating with any number of services 104.

System 100 also optionally includes a content distribution network 108,which is a collection of one or more computing devices that make dataavailable to computing device 102 and/or service 104. Contentdistribution network 108 can be implemented by one or more of a varietyof different types of devices, analogous to computing device 102.Service 104 can indicate to computing device 102 which data to obtain,if any, from content distribution network 108.

Computing device 102 includes a program 112 and a local cache 114. Localcache 114 is referred to as being local due to its being included aspart of computing device 102.

Program 112 includes a control module 116 and cached data detectionmodule 118. Although illustrated as two modules 116 and 118, it shouldbe noted that the functionality of one or both of modules 116 and 118can be separated into multiple modules, and/or that functionality ofmodules 116 and 118 can be combined into a single module. Control module116 performs the functionality of program 112 including generating auser interface for presentation to a user of computing device 102,responding to received user inputs, retrieving data from service 104and/or content distribution network 108 for presentation (or execution)by computing device 102, and so forth. Cached data detection module 118determines whether data for service 104 is provided to program 112 fromservice 104 or from local cache 114, as discussed in more detail below.The operation of control module 116 can vary based on the determinationmade by cached data detection module 118, as discussed in more detailbelow.

Service 104 includes a request handler module 122 and an instrumentationmodule 124. Although illustrated as two modules 122 and 124, it shouldbe noted that the functionality of one or both of modules 122 and 124can be separated into multiple modules, and/or that functionality ofmodules 122 and 124 can be combined into a single module. Requesthandler module 122 receives requests for data from program 112, andprovides the requested data to program 112 for presentation or executionby computing device 102. These requests for data can be requests forparticular pages (e.g., including data to be displayed and/or scripts),files, portions of files, and so forth. The particular data requestedcan vary based on the manner in which service 104 is implemented and thetype of services provided by service 104. Instrumentation module 124monitors requests received from computing device 102 and storesinformation regarding those requests in log 126, as discussed in moredetail below.

In one or more embodiments, program 112 is a Web browser. The Webbrowser sends requests for Web pages to service 104, and request handlermodule 122 returns the requested Web pages to the Web browser. The Webbrowser can also send requests for Web pages to content distributionnetwork 108, which returns the requested Web pages to the Web browser.These requested Web pages can include data to be displayed or otherwisepresented by computing device 102, as well as instructions or scriptsfor execution by or in program 112 to determine data to be displayed orotherwise presented by computing device 102. The Web browser can alsosend requests for particular files or particular data within a file toservice 104 (which returns the requested file or data to the Webbrowser) and/or to content distribution network 108 (which returns therequested file or data to the Web browser).

Program 112 has associated usage sessions. In one or more embodiments ausage session begins when program 112 begins running, and ends whenprogram 112 stops running. Each running of program 112 is thus adifferent usage session. In other embodiments, usage sessions can beginand end at different times, such as ending after a threshold amount oftime of inactivity of program 112 is detected (e.g., no user inputs forprogram 112 are received for a threshold amount of time), ending aparticular amount of time (e.g., one hour) after the usage sessionbegan, beginning when a previous usage session ends, and so forth.

Session identifiers are assigned to each usage session. In one or moreembodiments, a module of service 104 (such as instrumentation module124) assigns the session identifiers to the usage sessions, althoughalternatively other modules or components can assign the sessionidentifiers to the usage sessions. The session identifier is assigned inresponse to a request for data from service 104, and is returned toprogram 112 as part of the response to the request (e.g., in a cookieincluded as part of the response). Program 112 maintains the sessionidentifier for use during the usage session. Subsequent requests fordata that program 112 submits to service 104 during the usage sessioninclude the session identifier assigned to that usage session.Instrumentation module 124 can determine when to assign a sessionidentifier to a usage session in different manners, such as whenparticular data is initially requested by program 112 during a usagesession (e.g., a starting Web page or home Web page of service 104 isrequested, a log-in or authentication Web page of service 104 isrequested, and so forth), when a request is received that does notinclude a session identifier, and so forth.

A session identifier can be an alphanumeric or other value allowingdifferent sessions to be distinguished from one another by service 104.For example, a session identifier can be a Globally Unique Identifier(GUID). Different usage sessions have different session identifiers,allowing information regarding different usage sessions to be tracked.However, it should be noted that no information identifying theparticular computing device 102, or identifying the user of computingdevice 102, need be (and typically is not) recorded.

Instrumentation module 124 monitors requests received from computingdevice 102 and stores a record of information regarding those requestsin log 126. Various different information can be included in thisrecord, and in one or more embodiments the information included in thisrecord includes both a session identifier and an indication of the databeing requested. The session identifier is the session identifierassociated with the usage session of the program 112 (e.g., assigned toor included as part of a request received from program 112). The databeing requested is, for example, a particular Web page, a particularfile, a portion of a particular file, and so forth.

FIG. 2 illustrates example records in a log 200 in accordance with oneor more embodiments. Log 200 can be, for example, a log 126 of FIG. 1.In the illustrated example of FIG. 2, four records 202, 204, 206, and208 are illustrated. It should be noted that these records 202, 204,206, and 208 are examples, and that the records can be stored in any ofa variety of formats.

Record 202 indicates that for a usage session having “session identifier1”, a page of the service identified as “page 1” was requested andreturned to a program on a computing device (e.g., a device 102 of FIG.1). Record 204 indicates that for a usage session having “sessionidentifier 2”, the page of the service identified as “page 1” wasrequested and returned to a program on a computing device (which couldbe the same or a different computing device as the program with theusage session having “session identifier 1”). Record 206 indicates thatfor the usage session having “session identifier 1”, a file of theservice identified as “file 1” was requested and returned to the programon the computing device. This “file 1” can be the file requested as thecached data detection request. Record 208 indicates that for the usagesession having “session identifier 2”, a page of the service identifiedas “page 2” was requested and returned to the program on the computingdevice. Numerous additional records for the same or different usagesessions, as well as the same or different pages or files (or otherdata) can also be maintained in log 200.

Returning to FIG. 1, at some point after program 112 begins running,program 112 sends an initial request for data to service 104. Thisinitial request sent (for each usage session of program 112) is alsotypically a page request, which refers to a request for data (e.g., aWeb page) that is to be displayed or otherwise presented by computingdevice 102. As different page requests are sent by program 112, eachresponse to a page request is a page of data that typically replaces(although alternatively can be presented concurrently with) thepreviously displayed page. This initial request can be a page requestfor a starting Web page or home Web page of service 104, a request for alog-in or authentication Web page of service 104, and so forth. Thispage that is initially requested is a non-cacheable page, so the page isnot stored in local cache 114. Thus, each time this initial request issent, the request is responded to by service 104 (and a sessionidentifier can be assigned as discussed above).

After program 112 sends an initial request for data to service 104 andreceives the response, cached data detection module 118 sends a cacheddata detection request targeting service 104. Cached data detectionmodule 118 can determine a time to send the cached data detectionrequest targeting service 104 in a variety of different manners. In oneor more embodiments, module 118 sends the cached data detection requesta threshold amount of time (e.g., 5 seconds) after a “window.onload”event occurs indicating that the Web page requested in the initialrequest has finished loading at computing device 102. The cached datadetection request is typically sent only once per usage session, such asafter the first Web page (or another particular Web page known toprogram 112) is received from service 104. In other embodiments, module118 sends the cached data detection request at other times, such as athreshold amount of time after a response with a session identifier isreceived from service 104, a threshold amount of time after program 112begins running, and so forth.

The cached data detection request is a request for a particular file orfor data from a particular file. In one or more embodiments, in responseto a request for a page (e.g., a Web page) from program 112, service 104returns both the requested page and a session identifier assigned to thecurrent usage session. The returned page includes an image tag having anassociated identifier (e.g., a uniform resource locator (URL)) of a filestored by service 104 that includes the image data. Alternatively, theidentifier of the file can be determined in other manners, such as beingprogrammed into (or otherwise known or obtained by) program 112, beingincluded in a cookie received from service 104 along with the sessionidentifier, and so forth. Cached data detection module 118 identifiesthe identifier of the file, and sends a request (which is the cacheddata detection request) for the identified file, the request targetingservice 104. The identified file is typically a small file (e.g., zerobytes or one byte) because the identified file is used for the cacheddata detection discussed herein rather than for display of an image to auser of computing device 102. Alternatively, the identified file caninclude data that is displayed or otherwise used by computing device102. In one or more embodiments, all requests for the identified fileare treated by service 104 as cached data detection requests.

The cached data detection request targeting service 104 refers to thecached data detection request including an identifier of service 104indicating service 104 is the intended recipient of the request.However, the cached data detection request may not actually becommunicated to service 104. Computing device 102 maintains copies ofdata that was returned to computing device by service 104 and contentdistribution network 108 in response to previous requests sent byprogram 112 (and/or other programs on computing device 102) in localcache 114. When a request for data (e.g., a particular file or portionof a file) is sent by program 112 targeting service 104, computingdevice 102 checks local cache 114 to determine whether a valid (e.g.,non-expired) copy of the requested data is present in local cache 114.If a valid copy of the requested data is present in local cache 114,then the request is responded to by local cache 114 rather than beingsent to service 104. Thus, if the data requested in the cached datadetection request is included in local cache 114, the data is returnedto program 112 from local cache 114 rather than from service 104.

The identified file that is returned in response to the cached datadetection request has a cache retention policy (e.g., an expiration dateor time to live) that is the same as (or similar to) the cache retentionpolicy used by other data returned from service 104 and contentdistribution network 108. By using the same cache retention policy forthe files of service 104 and the identified file returned in response tothe cached data detection request, cached data detection module 118 canexpect that if the identified file returned in response to the cacheddata detection request is in local cache 114, then other files ofservice 104 are also included in local cache 114.

When service 104 receives a cached data detection request, requesthandler module 122 responds to the request by returning the requestedfile to program 112. In addition, request handler module 122 includes anindication that the response is provided by service 104. In one or moreembodiments, this indication is a cookie that is returned along with therequested file. The cookie can include some data indicating that thecookie was received from service 104 (or alternatively simply from someremote device or service), or alternatively can include no data.Alternatively, this indication that the response is provided by service104 can take other forms, as long as the indication is not cached inlocal cache 114 but the response is cached in local cache 114.

In one or more embodiments, local cache 114 does not cache cookies.Thus, although the file received from service 104 in response to thecached data detection request is stored in local cache 114, the cookiereceived from service 104 is not stored in local cache 114.Alternatively, in other embodiments both the file received from service104 and the cookie are stored in local cache 114. In such embodiments,service 104 assigns a short time to live or expiration time for thecookie (e.g., one second or five seconds). The cookie becomes invalidafter the time to live or expiration time has passed, and the cookie isdeleted if cached (or alternatively is simply ignored if cached). Inother implementations, although cookies may be stored in local cache114, those cookies are not returned along with files and/or other datafrom local cache 114 in response to requests from program 112.

Cached data detection module 118 determines whether data for service 104is provided to program 112 from service 104 or from local cache 114based on the presence of the cookie (or other indication that theresponse is provided by service 104). If, in response to the cached datadetection request, both the requested file and the cookie (or otherindication) are returned, then cached data detection module 118determines that the requested file was not in local cache 114, and wasreturned from service 104 rather than local cache 114. Because datareceived in response to requests is cached in local cache 114, cacheddata detection module 118 assumes that if the file requested in thecached data detection request is not stored in local cache 114 thenother data for service 104 (e.g., from service 104 or contentdistribution network 108) is also not stored in local cache 114. Thus,cached data detection module 118 detects that data for service 104 forthe current usage session is not cached in local cache 114.

However, if in response to the cached data detection request therequested file (but not the cookie or other indication) is returned,then cached data detection module 118 determines that the requested filewas in local cache 114, and was returned from local cache 114 ratherthan service 104. Because data received in response to requests iscached in local cache 114, cached data detection module 118 assumes thatif the file requested in the cached data detection request is stored inlocal cache 114 then other data for service 104 (e.g., from service 104or content distribution network 108) is also stored in local cache 114.Thus, cached data detection module 118 detects that data for service 104for the current usage session is cached in local cache 114.

Furthermore, instrumentation module 124 records in log 126 informationregarding requests received by computing device 102 as discussed above.Thus, log 126 includes a record of each request received from program112 having a particular session identifier, including requests for pagesas well as requests for particular files (e.g., the file requested asthe cached data detection request). The records in log 126 can thus beanalyzed (e.g., by service 104 or another device or service) to identifyhow many different session identifiers were assigned as well as how manycached data detection requests were received. If a cached data detectionrequest for a particular usage session was responded to by local cache114 then that particular cached data detection request was not sent toservice 104 and thus no record of the cached data detection requesthaving the session identifier for that usage session is included in log126.

Because data received in response to requests is cached in local cache114, it is assumed that if the cached data detection request was notreceived by service 104, then the file requested in the cached datadetection request (as well as other data for service 104 whether fromservice 104 or content distribution network 108) is also stored in localcache 114. Furthermore, it is assumed that if the cached data detectionrequest was received by service 104, then the file requested in thecached data detection request (as well as other data for service 104whether from service 104 or content distribution network 108) is notstored in local cache 114. Thus, an indication of how many usagesessions existed over a particular amount of time, as well as how manyof those usage sessions used data from a local cache rather thanrequesting the data from service 104 and/or content distribution network108, can be readily determined based on the records stored in log 126.

Log 126 maintains a record regarding requests received by service 104,such as both the session identifier and an indication of the data beingrequested, as discussed above. Different services 104 can maintaindifferent logs 126 (and/or different records within log 126 can beassociated with particular services 104), allowing the records to beanalyzed for different services 104. The different services 104 can bespecified or defined in different manners based on the desires of thedesigner or administrator of service 104. In one or more embodiments,the different services 104 are defined so that functionality using many(e.g., at least a threshold number) of the same files are groupedtogether as part of the same service 104. For example, a particularcompany or other entity may provide or otherwise make available variousfunctionality, such as email functionality, data storage functionality,word processing functionality, photo management functionality, and soforth. Each of these various functionalities can be a different service104, with records being maintained and/or analyzed separately for eachof these. Alternatively, multiple ones of these various functionalities(e.g., data storage functionality and photo management functionality)can be part of the same service 104.

In one or more embodiments, various functionality can be groupedtogether as part of the same service 104 using the cached data detectionrequests. For functionality that is grouped together, the sameidentified file (e.g., having the same URL) is used by the web pages forthat functionality. For example, if both data storage functionality andphoto management functionality are part of the same service, thenregardless of whether program 112 requests a Web page for the datastorage functionality or a Web page for the photo managementfunctionality, the same identified file (having the same URL) is used asthe cached data detection request.

It should also be noted that a cached data detection request can be usedat other levels of granularity other than functionality, such as foreach Web page provided by service 104 (or for particular Web pages ofinterest to a developer or administrator of service 104). For each suchWeb page, the cached data detection request targeting service 104 issent by program 112, allowing instrumentation module 124 to maintainrecords regarding whether a cached data detection request was receivedby service 104 for each such Web page of a usage session.

The data and instructions for service 104 are maintained in differentfiles of service 104 and/or content distribution network 108, and thesefiles can change over time as desired by the developer or administratorof service 104 in order to change the functionality of service 104.Different version numbers for service 104 can be maintained, andsimilarly cached data detection requests can include version numbers.The cached data detection requests can include version numbers indifferent manners, such as by using different URLs for differentversions, including a query string that identifies the version number atthe end of a URL, and so forth. When the files of service 104 and/ornetwork 108 are updated, the version number of the cached data detectionrequest is also updated. The version number can be included as part ofthe information that is recorded in log 126 for requests, allowingrecords to be maintained of different versions of the files for service104 that are obtained from service 104 (or network 108) rather than fromlocal cache 114.

In one or more embodiment, files and data returned by service 104 and/orcontent distribution network 108 can be marked as cacheable public orcacheable private. A file or data being marked cacheable publicindicates that the file or data can be stored in local cache 114 as wellas one or more other proxy servers that are coupled to or part ofnetwork 106. Such files or data cached in a proxy server can be returnedto program 112 as if they were returned by service 104 (including anycookie as discussed above). A file or data being marked cacheableprivate, however, indicates that the file or data can be stored in localcache 114 but not in other proxy servers. The cached data detectionrequest is marked as cacheable private, so that if a response to thecached data detection request is not returned by local cache 114 thecached data detection request is responded to by service 104 (and arecord of the cached data detection request is maintained in log 126)rather than a proxy server or other intermediary.

In addition, the cached data detection request can be leveraged todetermine a latency and/or bandwidth between computing device 102 andservice 104. The latency between computing device 102 and service 104refers to an amount of time taken for responses to requests to bereceived by computing device 102. A time when the cached data detectionrequest is sent by program 112 to service 104 and a time when theresponse to the cached data detection request is received by program 112from service 104 (which is known because the response includes thecookie as discussed above) can be identified, and a difference betweenthose two times can be calculated. This difference is determined byprogram 112 to be the round trip time, and this difference can bedivided by two in order to determine a latency (an amount of time takenfor data to be downloaded to computing device 102 from service 104).Program 112 can also assume that this latency between computing device102 and service 104 is the same as the latency between computing device102 and content distribution network 108.

As discussed above, after program 112 sends a page request for data toservice 104 and receives the response, cached data detection module 118sends a cached data detection request targeting service 104. In one ormore embodiments, the file or data that is requested by the cached datadetection request is stored on the same device of service 104 as thedata that was returned in response to the page request. Thus, acommunication channel established between computing device 102 and thatdevice of service 104 (e.g., using any of a variety of conventional orproprietary handshake or communication protocols) for the page requestis also used for the cached data detection request. This use of the samecommunication channel improves the accuracy of the latency determinationbecause the latency determination excludes time taken to establish thecommunication channel.

The bandwidth between computing device 102 and service 104 refers to arate at which data can be communicated between computing device 102 andservice 104. The bandwidth can be determined based on a time taken todownload an additional large file. This additional file being largerefers to the file being at least a threshold size (e.g., at least50-100 kilobytes), and this additional file can include image content,audio content, other instructions or data, and so forth. This additionalfile is typically a file that is normally downloaded by computing device102 from service 104 or content distribution network 108. Separateadditional files can be downloaded from each of service 104 and contentdistribution network 108 to determine bandwidth between each of device102 and service 104, and device 102 and content distribution network108, respectively. Alternatively, the additional file can be downloadedfrom one of service 104 and content distribution network 108, and thebandwidth determined being the bandwidth for both service 104 andcontent distribution network 108.

To determine the bandwidth, the time taken to download the additionalfile is determined. This time taken to download the additional file isthe difference between the time when the request for the additional fileis sent by device 102 and the time when the additional file has beenreceived by device 102. The bandwidth is then calculated as follows:

${bandwidth} = \frac{size}{{dt} - {rtt}}$where “bandwidth” is the bandwidth being calculated, “size” is the sizeof the additional file being downloaded, “dt” is the download time forthe additional file request (the time taken to download the additionalfile), and “rtt” is the round trip time for the cached data detectionrequest.

Cached data detection module 118 detects whether data for service 104for the current usage session is cached in local cache 114 as discussedabove, and program 112 can use the result of this detection, andoptionally the determined latency and/or bandwidth, in a variety ofdifferent manners. A variety of different rules or criteria can be usedby program 112 to determine how to alter the behavior of program 112(e.g., control module 116) in obtaining files from service 104 and/orcontent distribution network 108 during a particular usage session basedon the result of this detection, the determined latency, and/or thedetermined bandwidth. These rules or criteria can be programmed as partof, or otherwise obtained by, program 112. The behavior of program 112can be altered in different manners, such as altering the rate at whichfiles are requested from service 104 and/or content distribution network108, altering whether files are requested from service 104 and/orcontent distribution network 108 in parallel or serially, and so forth.

For example, a rule can indicate that if data for service 104 isdetected as being in local cache 114, then additional files arerequested one-by-one because program 112 expects them to be returnedquickly from local cache 114. By way of another example, a rule canindicate that if data for service 104 is detected as not being in localcache 114, then additional files can be requested in groups (e.g., acompressed file including multiple ones of the additional files) becauseprogram 112 expects them to be returned over network 106 which will beslower than if they are returned from local cache 114. By way of yetanother example, a rule can indicate that if the bandwidth and/orlatency are below a threshold amount, then program 112 is to display abutton or other option allowing the user to request that smaller files(e.g., lower-resolution images or scripts with less functionality) beretrieved by program 112, which would be expected to be retrieved morequickly by program 112 than larger files.

Log 126 can be used to determine an indication of how many usagesessions existed over a particular amount of time, as well as how manyof those usage sessions used data from a local cache rather thanrequesting the data from service 104 and/or content distribution network108, as discussed above. These determinations can be used to alter thebehavior and/or implementation of service 104, such as by service 104itself or by a developer or administrator of service 104. Thisalteration of service 104 is typically implemented so as to tailor thebehavior of service 104 to provide improved performance or userexperience for users of devices that have the data from service 104and/or network 108 already cached (e.g., if at least a threshold numberof usage sessions used data from a local cache rather than requesting itfrom service 104 or network 108), or to provide improved performance oruser experience for users of devices that do not have the data fromservice 104 and/or network 108 already cached (e.g., if less than athreshold number of usage sessions used data from a local cache ratherthan requesting it from service 104 or network 108).

For example, service 104 can be altered so that fewer and/or smallerfiles are typically initially used by program 112 during a usagesession, allowing additional time for program 112 to retrieve thosefiles prior to using them. By way of another example, service 104 canmake differently sized files available to program 112 (e.g.,lower-resolution images or scripts with less functionality). By way ofyet another example, additional data and/or instructions can be includedin program 112 rather than as part of service 104 and/or contentdistribution network 108, thereby reducing the amount of data and/orinstructions that are retrieved by program 112 from service 104 and/ornetwork 108.

FIG. 3 is a flowchart illustrating an example process 300 for acomputing device implementing cached data detection in accordance withone or more embodiments. Process 300 is carried out by a program of acomputing device, such as program 112 of FIG. 1, and can be implementedin software, firmware, hardware, or combinations thereof. Process 300 isshown as a set of acts and is not limited to the order shown forperforming the operations of the various acts. Process 300 is an exampleprocess for implementing cached data detection; additional discussionsof implementing cached data detection are included herein with referenceto different figures.

In process 300, when the program desires a page from a service, adetermination is made as to whether a session identifier for the currentusage session has been received (act 302). The session identifier isreceived, for example, in response to an initial page request to aservice as discussed above.

If a session identifier has been received, then a page or data requestand the session identifier for the current usage session are senttargeting the service (act 304). Requests targeting the service can beresponded to from the service or from a local cache as discussed above.The request can be for a particular page, particular file, particulardata from a file, and so forth.

The requested page or data is received and loaded (act 306). Loading ofthe requested page or data refers to displaying or otherwise presentingthe received page or data.

Returning to act 302, if the session identifier for the current usagesession has not been received, then a page request targeting the serviceis sent (act 308). Requests targeting the service can be responded tofrom the service or from a local cache as discussed above. As thesession identifier for the current usage session has not been received,the page request in act 308 is also the initial page request for theservice as discussed above.

The requested page and a session identifier for the current usagesession are received (act 310), and the requested page is loaded (act312). The received session identifier is maintained for use during thecurrent usage session.

A cached data detection request and the session identifier of thecurrent usage session are also sent targeting the service (act 314), anda response to the cached data detection request with the requested datais received (act 316).

A determination is made as to whether the response received in act 316was returned from a local cache or the service (act 318). This check canbe made based on whether a cookie or other indication that the requesteddata is provided by the service is received with the response, asdiscussed above.

If the response was returned by the service, then the determination ismade that the data for the service is not in the local cache (320).Thus, data for the service is expected to be returned by the service asdiscussed above.

However, if the response was returned by the local cache, then thedetermination is made that the data for the service is in the localcache (322). Thus, data for the service is expected to be returned bythe local cache as discussed above.

FIG. 4 is a flowchart illustrating an example process 400 for a serviceimplementing cached data detection in accordance with one or moreembodiments. Process 400 is carried out by a service, such as service104 of FIG. 1, and can be implemented in software, firmware, hardware,or combinations thereof. Process 400 is shown as a set of acts and isnot limited to the order shown for performing the operations of thevarious acts. Process 400 is an example process for implementing cacheddata detection; additional discussions of implementing cached datadetection are included herein with reference to different figures.

In process 400, a request is received from a program running on a device(act 402). Different types of requests can be received, including pagerequests and cached data detection requests. Although discussed withreference to page requests, requests for other data or files (other thancached data detection requests) are handled analogously to pagerequests.

If the received request is a page request, then a determination is madeas to whether the page request is received as part of a new usagesession (act 404). This determination can be made in different manners,such as based on whether a session identifier is included with therequest. If the request includes a session identifier, then the requestis not part of a new usage session; however, if the request does notinclude a session identifier, then the request is part of a new usagesession.

If the request is not part of a new usage session, then the sessionidentifier as received with the request in act 402 and informationregarding the page request is stored in a log (act 406). Variousinformation regarding the page request can be stored in the log asdiscussed above. The requested page is also returned to the program (act408).

However, if the request is part of a new usage session, then a sessionidentifier is assigned to the usage session (act 410). The sessionidentifier can be assigned in different manners as discussed above.

Additionally, the session identifier assigned in act 410 and informationregarding the page request is stored in the log (act 412). Variousinformation regarding the page request can be stored in the log asdiscussed above. The requested page as well as the identifier assignedin act 410 are returned to the program (act 414).

Returning to act 402, if the request is a cached data detection request,then the session identifier as received with the request in act 402 andinformation regarding the cached data detection request is stored in thelog (act 416). Various information regarding the cached data detectionrequest can be stored in the log as discussed above. Additionally, therequested data as well as a cookie or other indicator that the responseis being provided from the service are returned to the program (act418).

Various actions such as communicating, receiving, sending, storing,generating, obtaining, and so forth performed by various modules arediscussed herein. It should be noted that the various modules can causesuch actions to be performed. A particular module causing an action tobe performed includes that particular module itself performing theaction, or alternatively that particular module invoking or otherwiseaccessing another component or module that performs the action (orperforms the action in conjunction with that particular module).

FIG. 5 illustrates an example computing device 500 that can beconfigured to implement the cached data detection in accordance with oneor more embodiments. Computing device 500 can be, for example, computingdevice 102 of FIG. 1, a device implementing at least part of service 104of FIG. 1, or a device implementing at least part of contentdistribution network 108 of FIG. 1.

Computing device 500 includes one or more processors or processing units502, one or more computer readable media 504 which can include one ormore memory and/or storage components 506, one or more input/output(I/O) devices 508, and a bus 510 that allows the various components anddevices to communicate with one another. Computer readable media 504and/or one or more I/O devices 508 can be included as part of, oralternatively may be coupled to, computing device 500. Bus 510represents one or more of several types of bus structures, including amemory bus or memory controller, a peripheral bus, an acceleratedgraphics port, a processor or local bus, and so forth using a variety ofdifferent bus architectures. Bus 510 can include wired and/or wirelessbuses.

Memory/storage component 506 represents one or more computer storagemedia. Component 506 can include volatile media (such as random accessmemory (RAM)) and/or nonvolatile media (such as read only memory (ROM),Flash memory, optical disks, magnetic disks, and so forth). Component506 can include fixed media (e.g., RAM, ROM, a fixed hard drive, etc.)as well as removable media (e.g., a Flash memory drive, a removable harddrive, an optical disk, and so forth).

The techniques discussed herein can be implemented in software, withinstructions being executed by one or more processing units 502. It isto be appreciated that different instructions can be stored in differentcomponents of computing device 500, such as in a processing unit 502, invarious cache memories of a processing unit 502, in other cache memoriesof device 500 (not shown), on other computer readable media, and soforth. Additionally, it is to be appreciated that the location whereinstructions are stored in computing device 500 can change over time.

One or more input/output devices 508 allow a user to enter commands andinformation to computing device 500, and also allows information to bepresented to the user and/or other components or devices. Examples ofinput devices include a keyboard, a cursor control device (e.g., amouse), a microphone, a scanner, and so forth. Examples of outputdevices include a display device (e.g., a monitor or projector),speakers, a printer, a network card, and so forth.

Various techniques may be described herein in the general context ofsoftware or program modules. Generally, software includes routines,programs, applications, objects, components, data structures, and soforth that perform particular tasks or implement particular abstractdata types. An implementation of these modules and techniques may bestored on or transmitted across some form of computer readable media.Computer readable media can be any available medium or media that can beaccessed by a computing device. By way of example, and not limitation,computer readable media may comprise “computer storage media” and“communications media.”

“Computer storage media” include volatile and non-volatile, removableand non-removable media implemented in any method or technology forstorage of information such as computer readable instructions, datastructures, program modules, or other data. Computer storage mediainclude, but are not limited to, RAM, ROM, EEPROM, flash memory or othermemory technology, CD-ROM, digital versatile disks (DVD) or otheroptical storage, magnetic cassettes, magnetic tape, magnetic diskstorage or other magnetic storage devices, or any other medium which canbe used to store the desired information and which can be accessed by acomputer.

“Communication media” typically embody computer readable instructions,data structures, program modules, or other data in a modulated datasignal, such as carrier wave or other transport mechanism. Communicationmedia also include any information delivery media. The term “modulateddata signal” means a signal that has one or more of its characteristicsset or changed in such a manner as to encode information in the signal.By way of example, and not limitation, communication media include wiredmedia such as a wired network or direct-wired connection, and wirelessmedia such as acoustic, RF, infrared, and other wireless media.Combinations of any of the above are also included within the scope ofcomputer readable media.

Generally, any of the functions or techniques described herein can beimplemented using software, firmware, hardware (e.g., fixed logiccircuitry), manual processing, or a combination of theseimplementations. The terms “module” and “component” as used hereingenerally represent software, firmware, hardware, or combinationsthereof. In the case of a software implementation, the module orcomponent represents program code that performs specified tasks whenexecuted on a processor (e.g., CPU or CPUs). The program code can bestored in one or more computer readable memory devices, furtherdescription of which may be found with reference to FIG. 5. The featuresof the cached data detection techniques described herein areplatform-independent, meaning that the techniques can be implemented ona variety of commercial computing platforms having a variety ofprocessors.

Although the subject matter has been described in language specific tostructural features and/or methodological acts, it is to be understoodthat the subject matter defined in the appended claims is notnecessarily limited to the specific features or acts described above.Rather, the specific features and acts described above are disclosed asexample forms of implementing the claims.

What is claimed is:
 1. A method implemented in a service, the methodcomprising: receiving, from programs running on computing devices remotefrom the service, page requests for one or more pages from the service;storing, by the service, for each page request, information regardingthe page request and a session identifier associated with a usagesession of the program from which the page request is received;receiving, from one or more of the programs, both a cached datadetection request and the session identifier associated with the usagesession of the program from which the cached data detection request isreceived; storing, by the service, for each cached data detectionrequest, information regarding the cached data detection request and thesession identifier; determining, by the service, based on the storedinformation, how many usage sessions existed over a particular amount oftime, and how many of the usage sessions used data from local caches ofthe remote computing devices rather than from the service; anddetermining, based on the stored information, a percent of usagesessions that used data from a local cache rather than from the service,the percent determined by comparing a ratio of a number of sessionidentifiers that are assigned and a number of cached data detectionrequests that are received.
 2. A method as recited in claim 1, furthercomprising: assigning the session identifier associated with the usagesession in response to an initial page request to the service for theusage session; and returning both the session identifier and therequested page in response to the initial page request.
 3. A method asrecited in claim 1, the cached data detection request comprising arequest for a particular file or data.
 4. A method as recited in claim3, the cached data detection request identifying the particular file ordata by a uniform resource locator (URL), the URL including a versionidentifier that is updated each time one or more files of the serviceare updated.
 5. A method as recited in claim 3, further comprisingreturning, in response to the cached data detection request, theparticular file or data as well as a cookie indicating that the responseto the cached data detection request is from the service.
 6. A method asrecited in claim 5, the particular file or data having a same cacheretention policy as one or more other files of the service.
 7. A methodas recited in claim 1, the service implemented on one or more differenttypes of computing devices that are remote relative to the one or morecomputing devices running the programs and being one of multipleservices provided by an entity, the functionality included in theservice being specified by the entity.
 8. A method implemented in aservice, the method comprising: receiving, from programs running oncomputing devices remote from the service, page requests for one or morepages from the service; storing, by the service, for each page request,information regarding the page request and a session identifierassociated with a usage session of the program from which the pagerequest is received; receiving, from one or more of the programs, both acached data detection request and the session identifier associated withthe usage session of the program from which the cached data detectionrequest is received, the cached data detection request comprising arequest for a particular file identified by a uniform resource locator(URL); storing, by the service, for each cached data detection request,information regarding the cached data detection request and the sessionidentifier; tracking, by the service, based on the stored informationregarding session identifiers and cached data detection requests,whether the remote computing devices already have the particular filecached locally at the remote computing devices; returning, by theservice, in response to each cached data detection request, a responsewith both the particular file and a cookie indicating that the responsewith the particular file is being returned by the service, theparticular file having a same cache retention policy as other filesprovided to the program from the service; and determining, based on thestored information, a percent of usage sessions that used data from alocal cache rather than from the service, the percent determined bycomparing a ratio of a number of session identifiers that are assignedand a number of cached data detection requests that are received.
 9. Amethod as recited in claim 8, further comprising: assigning the sessionidentifier associated with the usage session in response to an initialpage request to the service for the usage session; and returning boththe session identifier and the requested page in response to the initialpage request.
 10. A method as recited in claim 8, the URL including aversion identifier that is updated each time one or more files of theservice are updated.
 11. A method as recited in claim 8, the serviceimplemented on one or more different types of computing devices that areremote relative to the one or more computing devices running theprograms and being one of multiple services provided by an entity, thefunctionality included in the service being specified by the entity. 12.A method as recited in claim 1, further comprising altering, based onhow many usage sessions existed over the particular amount of time andhow many of the usage sessions used data from local caches of the remotecomputing devices rather than from the service, a behavior of theservice.
 13. One or more computing devices implementing a service, theone or more computing devices comprising: one or more hardwareprocessors; and an instrumentation module and a request handler moduleimplementing one or more programs that, when executed by the one or morehardware processors, cause the one or more hardware processors toperform acts comprising: receiving, from programs running on computingdevices remote from the service, page requests for one or more pagesfrom the service; storing, by the service, for each page request,information regarding the page request and a session identifierassociated with a usage session of the program from which the pagerequest is received; receiving, from one or more of the programs, both acached data detection request and the session identifier associated withthe usage session of the program from which the cached data detectionrequest is received; storing, by the service, for each cached datadetection request, information regarding the cached data detectionrequest and the session identifier; determining, by the service, basedon the stored information, how many usage sessions existed over aparticular amount of time, and how many of the usage sessions used datafrom local caches of the remote computing devices rather than from theservice; and determining, based on the stored information, a percent ofusage sessions that used data from a local cache rather than from theservice, the percent determined by using a ratio of a number of sessionidentifiers that are assigned and a number of cached data detectionrequests that are received.
 14. One or more computing devices as recitedin claim 13, the acts further comprising: assigning the sessionidentifier associated with the usage session in response to an initialpage request to the service for the usage session; and returning boththe session identifier and the requested page in response to the initialpage request.
 15. One or more computing devices as recited in claim 13,the cached data detection request comprising a request for a particularfile or data.
 16. One or more computing devices as recited in claim 15,the cached data detection request identifying the particular file ordata by a uniform resource locator (URL), the URL including a versionidentifier that is updated each time one or more files of the serviceare updated.
 17. One or more computing devices as recited in claim 15,the acts further comprising returning, in response to the cached datadetection request, the particular file or data as well as a cookieindicating that the response to the cached data detection request isfrom the service.
 18. One or more computing devices as recited in claim17, the particular file or data having a same cache retention policy asone or more other files of the service.
 19. One or more computingdevices as recited in claim 13, the service being one of multipleservices provided by an entity, the functionality included in theservice being specified by the entity.
 20. One or more computing devicesas recited in claim 13, the acts further comprising altering, based onhow many usage sessions existed over the particular amount of time andhow many of the usage sessions used data from local caches of the remotecomputing devices rather than from the service, a behavior of theservice.